package io.fatmore.web;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 基础controller
 * <b><code>BaseController</code></b>
 * <p>
 * 
 * </p>
 * <b>Creation Time:</b> 2016年9月12日 下午6:36:24
 * @author shangkun.lsk@fastmor.com
 * @since ucun-finance
 */
public class BaseController {

	private Boolean debug;

	/**
	 * 查看是否处于debug模式，用于开发和测试
	 * 
	 *
	 * @return
	 * @since ucun-finance
	 */
	public boolean isDebugMode(){
	    return false;
	}

	@Resource
	private HttpServletRequest request;
	@Resource
	private HttpServletResponse response;

	public String getParam(String key) {
		if (request == null) {
			return null;
		}
		return request.getParameter(key);
	}


	public HttpServletRequest getRequest() {
		return request;
	}

	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}

	public HttpServletResponse getResponse() {
		return response;
	}

	public void setResponse(HttpServletResponse response) {
		this.response = response;
	}

}
